/*
 * Copyright (c) 2021. Moses All Right Reserved
 */

package com.moses.design_patterns.prototype;

/**
 * @author Moses
 * @email shenhuohui@gmail.com
 * @date 2021/4/10 15:57
 */
public class Prototype implements Cloneable{
    // 通过 clone 方法时，构造函数不会被调用
    public Prototype(){
        System.out.println("Prototype created.");
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        // 注意这样子的拷贝，是浅拷贝
        return super.clone();
    }
}
